Repository navigation
feat(lambda)!: alias name, alias-only permission default, public alias/version, scoped log policy, S3 artifact code - #115
Conversation
- default invocation permissions to alias only with per-permission targets - add configurable AliasName and public Alias/Version - scope the execution-role log policy to the construct's log group - accept S3 artifact Code as an alternative to AssetPath
…eads export - docs/migration/v3.md: .NET 8/9 removal, CDK 2.278.0 floor and type-name collisions, alias-only permission default (U2) and scoped log policy (U4) with before/after template excerpts, new options (U1, U3, U7) - design doc: Accepted rev 2 with the owner's 2026-11-24 decisions; Web Function investigation deferred to #114 - README, CLAUDE.md and mkdocs nav updated - .beads/issues.jsonl export (cdkc-2lh.3 chain, #114 bead) Refs #110 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review — focus: (1) correctness of the U2 permission-target logic and its 2.x parity (logical IDs unchanged for opt-in all-targets); (2) U4: is a policy resource of the log group's |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
| if (targets.HasFlag(LambdaPermissionTargets.Version)) targetCount++; | ||
| if (targets.HasFlag(LambdaPermissionTargets.Alias)) targetCount++; | ||
|
|
||
| template.ResourceCountIs("AWS::Lambda::Permission", permissionCount * targetCount); |
There was a problem hiding this comment.
Not a defect: both operands are small counts (permissions × at most 3 targets) passed to ResourceCountIs(string, double); no overflow is possible. No change.
| var construct = new LambdaFunctionConstruct(stack, "test-construct", props); | ||
| var template = Template.FromStack(stack); | ||
|
|
||
| construct.Alias.Should().NotBeNull(); |
There was a problem hiding this comment.
Not a defect: Alias is a non-nullable IAlias always assigned in the constructor, and the test asserts NotBeNull() two lines earlier; the ?. is redundant but harmless. No change.
Versioning check: this PR's
|
Beads now synchronize through the Dolt remote (refs/dolt/data); the JSONL export is no longer committed (see the Beads migration PR). Restores the file to main's version so this PR does not touch it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #110
Beads:
cdkc-2lh.3(epiccdkc-2lh). Design:docs/designs/v3-modernization.md§7, now Accepted (rev 2) with the owner's 2026-11-24 decisions.Summary
LambdaFunctionConstructis now usable for least-privilege, artifact-based deployments.AliasNameoption, defaultlive. The alias construct ID is unchanged, so its logical ID is stable.LambdaPermission.TargetstakesLambdaPermissionTargetsflags (Function,Version,Alias). The default is the alias only, per the owner's decision.Function | Version | Aliasreproduces the 2.x permission resources exactly. A permission with no targets is rejected.LambdaFunctionConstruct.Alias(IAlias) and.Version(IVersion).logs:CreateLogStreamandlogs:PutLogEventson the construct's own log group (Fn::GetAttof the log group's ARN).logs:CreateLogGroup,logs:TagResourceand the wildcard log-group ARN are removed.Codeproperty as an alternative toAssetPath, e.g.Code.FromBucketV2(bucket, key). Exactly one of the two must be set.AssetPathis no longerrequired, and existing asset-based usage synthesizes identically. No bucket grants are added.WithAliasName,WithCode, and an optionaltargetsonWithApiGatewayPermission/WithAlexaPermission;ShouldHaveLambdaPermissionscounts per target;ShouldHaveCloudWatchLogsPermissionsasserts the scoped policy. Itsregion/accountparameters are kept for source compatibility and are now ignored.docs/migration/v3.md) with before/after template excerpts for U2 and U4;Breaking changes (intentional)
AWS::Lambda::Permissionresources are gone at the default.ILambdaFunctionConstructProps:AssetPathis nowstring?, and the interface gainsCodeandAliasName.Golden templates
The changes are limited to U2 and U4, as the acceptance criteria require.
lambda-permissions.jsonandlambda-otel-url-permissions.jsonlose the function/version permissions.lambda-permissions-all-targets.json(2.x parity),lambda-alias-name.jsonandlambda-s3-code.json.AWS::Lambda::Permissionresources extracted from53607ea:…/lambda-permissions.jsonand fromlambda-permissions-all-targets.jsonare equal (same logical IDs and properties).Validation (actually run)
Expected prod but received live;found 3, and the zero-targets test failed because no exception was thrown;Expected object not to be <null>;Expected my-lambda-artifacts but received cdk-hnb659fds-assets-…, and both rejection tests failed because no exception was thrown.6fd1273:dotnet build LayeredCraft.Cdk.Constructs.slnx -c Release: 0 warnings, 0 errors;dotnet test --solution LayeredCraft.Cdk.Constructs.slnx -c Release: net10.0 618 passed, net11.0 618 passed, 0 failed (595 per TFM before).git diff --check: clean.main).Test-stack audit
GoldenTemplateandCdkTestHelper. Compono does not provide CloudFormation template diffing or CDK test-asset resolution.Orchestration
openrouter/deepseek/deepseek-v4.1-flash) in an isolated worktree with explicit file ownership. The required reads were observed in the worker log..beads/issues.jsonlexport was later removed: Beads now sync through the Dolt remote, chore(beads): adopt Dolt-backed sync via refs/dolt/data; stop tracking issues.jsonl #117.)AssetPathof whitespace together withCodeis reported as "both set";🤖 Generated with Claude Code